@import "./_golfer.css";

details > div {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(21rem, 1fr));
}

details:not(:has(.cheevo)) { display: none }

main {
    gap: 0;
    padding: 0;

    .tabs { margin: 1rem 1rem 0 }
}

progress {
    -webkit-appearance: none;
    appearance: none;
    background: none;
    border: 1px solid var(--color);
    grid-column: span 2;
    height: .5rem;
    width: 100%;

    /* ::track/fill eventually https://drafts.csswg.org/css-forms-1/#slider-pseudos */
    &::-moz-progress-bar,
    &::-webkit-progress-value { background: var(--link-color) }
    &::-webkit-progress-bar   { background: none }
}

summary {
    background: var(--background);
    border: 0;
    color: var(--color);
    font-size: 1.5rem;
    font-variant: tabular-nums;
    font-weight: bold;
    padding: 1rem;
    position: sticky;
    top: calc(5.75rem + 2px);
    z-index: 1;

    &:hover { background: var(--background) !important }
}

.cheevo {
    --step-width: 6rem;

    /* Some steps look better in different sizes */
    &#cheevo-alphabet-soup, &#cheevo-pangramglot,
    &#cheevo-sinosphere,    &#cheevo-sounds-quite-nice {
        --step-width: 2.375rem;
    }

    display: grid;
    gap: .5rem 1rem;
    grid-template: auto 1fr auto / auto 1fr;
    padding: 1rem;

    .emoji {
        font-size: 4rem;
        grid-row: span 3;
    }

    fieldset {
        border: 0;
        display: grid;
        font-weight: normal;
        gap: .25rem;
        grid-column: span 2;
        grid-template-columns: repeat(auto-fit, minmax(var(--step-width), 1fr));
        padding: 0 0 .25rem 0;

        > label {
            display: flex;
            font-size: .75rem;
            gap: .375rem;

            > :is(a, span) {
                flex: 1;
                overflow: hidden;
                text-overflow: ellipsis;
                text-wrap: nowrap;
            }
        }
    }

    footer {
        display: grid;
        font-size: .75rem;
        font-weight: bold;
        gap: .25rem;
        grid-template-columns: 1fr auto;
    }

    &:not(.earned) {
        background: var(--light-grey);

        .emoji {
            color: transparent;
            text-shadow: 0 0 var(--cheevo-not-earned);
        }

        footer > span { color: var(--red-text) }
    }
}
